package com.design.composite.repository;

import com.design.composite.entity.Records;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author liuyajun
 */
public interface RecordsRepository extends JpaRepository<Records, Integer> {

    /**
     * 根据code删除记录
     *
     * @param code
     */
    @Transactional
    @Modifying
    void deleteByCode(String code);

    List<Records> findByCode(String code);

}

